< previous page page_53 next page >

Page 53
This example also allows users to display any file type by selecting the Any Files filter type.
You can change many different settings for the Flags property. The ones used in this example application are:
cdlOFNFileMustExist. If this flag is set for the Open dialog box, users can select only files that exist.
cdlOFNOverwritePrompt. This causes the Save As dialog box to confirm an overwrite of an existing file.
For a complete list of these values, see the help topic for the Common Dialog control's Flags property.
For the enhanced version of the FileCopy project, you'll add a new form, as shown in Figure 2.5, as well as modify the original form and the code in the project.
12181-0053a.gif
Figure 2.5.
The new file process form interface for
the
FileCopy project.
Notice that the new form has several command buttons on it as well as two text boxes and labels. Of course, it also has the Common Dialog control. In the original form, delete the command button controls from the form and reduce the size to match the form in Figure 2.6. Save this new project as dlgFileOpenCopy.
12181-0053b.gif
Figure 2.6.
Changing the old form to enhance the
functionality of the project.
Next, rename the original form to frmStatus and then display its code. Rename the FileCopy_Click routine to FileProcess, and then remove all the other routines in this form. Cut the FileProcess routine from the frmStatus form and paste it into the new

 
< previous page page_53 next page >

If you like this book, buy it!